package cn.amebius.simpledocker.entity.po;

import cn.amebius.simpledocker.exception.DataErrorException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * tb_docker的Po
 * @author 阿伟
 * @date 2023/7/28 20:05
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class DockerPo extends BasePo{

    private String name;

    private String host;

    private String port;

    private String type;

    private String username;

    private String password;

    public static void check(DockerPo dp) {
        if (dp == null || dp.name.isEmpty() || dp.host.isEmpty() || dp.port.isEmpty()
                || dp.type.isEmpty() || dp.username.isEmpty() || dp.password.isEmpty()) {
            throw new DataErrorException("数据异常:docker主机丢失");
        }
        BasePo.check(dp);
    }
}
